package main.client;

import java.util.ArrayList;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface ServerSideAsync {
	
	/* Init */
	void hagf(AsyncCallback<String> callback);
	
	/* User handling */
	void registerUser(User user, String password, AsyncCallback<String> callback);
	void validateUser(String username, String password, AsyncCallback<User> callback);
	void getCurrentUser(AsyncCallback<User> callback);
	void updateUser(User user, String password, AsyncCallback<String> callback);
	void logout(AsyncCallback<Integer> callback);
	void checkAdmin(AsyncCallback<Integer> callback);
	void getUsers(AsyncCallback<ArrayList<User>> callback);
	void getUser(Integer id,AsyncCallback<User> callback);
	void removeUser(Integer id,AsyncCallback<String> callback);
	
	/* Item handling */
	void addItem(Item item, AsyncCallback<Integer> callback);
	void getItem(int itemId, AsyncCallback<Item> callback);
	void removeItem(int itemId, AsyncCallback<String> callback);
	void getAllItems(int category, AsyncCallback<ArrayList<Item>> callback);
	void getPopularItem(int category, AsyncCallback<Item> callback);
	void getPopular(AsyncCallback<ArrayList<Item>> callback);
	
	/* Category handling */
	void addCategory(String name, int parent, AsyncCallback<String> callback);
	void removeCategory(int id, AsyncCallback<String> callback);
	
	/* Cart handling */
	void addCartItem(Item item, AsyncCallback<String> callback);
	void removeCartItem(int itemId, AsyncCallback<String> callback);
	void getCart(AsyncCallback<ArrayList<Item>> callback);
	void removeCart(AsyncCallback<String> callback);
	void buyItems(AsyncCallback<String> callback);
	void getCarts(AsyncCallback<ArrayList<Cart>> callback);
}
